package com.car.postoffice;

public class CMail {
	private CEnvelope envelope;
	private CMailHeader header;
	private byte[] mailContent;
	
	public CMail(String srcScheme, String srcPath,
				 String dstScheme, String dstPath){
		envelope = new CEnvelope(new CAddress(srcScheme, srcPath),
								 new CAddress(dstScheme, dstPath));
		header = new CMailHeader(null);
	}
	
	public CMail(CAddress srcAddr, CAddress dstAddr){
		envelope = new CEnvelope(srcAddr, dstAddr);
		header = new CMailHeader(null);
	}
	
	public CEnvelope getEnvelope() {
		return envelope;
	}

	public void setEnvelope(CEnvelope envelope) {
		this.envelope = envelope;
	}
	
	public byte[] getMailContent() {
		if(mailContent == null){
			return new byte[0];
		}
		return mailContent;
	}
	
	public CMailHeader getHeader() {
		return header;
	}

	public void setHeader(CMailHeader header) {
		this.header = header;
	}

	public void setMailContent(byte[] mailContent) {
		this.mailContent = mailContent;
	}

	
}
